package com.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.aliyunApi.AliyunApi;

///控制压路机的运行
@RestController
public class RollerController {
	
	@RequestMapping(value ="SetRunState",method = RequestMethod.GET)	
	public int SetRunState()
	{
		Integer state = 0;
		try {
			return  AliyunApi.startControl(state,0);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return 1;
	}
	
	
	///暂停
	
	@RequestMapping(value ="SetPauseState",method = RequestMethod.GET)	
	public int SetPauseState()
	{
		Integer state = 0;
		try {
			return  AliyunApi.startControl(state,1);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return 1;
	}
	
	//停止
	@RequestMapping(value ="SetStopState",method = RequestMethod.GET)	
	public int SetStopState()
	{
		Integer state = 0;
		try {
			return  AliyunApi.startControl(state,2);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return 1;
	}
}
